import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import Login from '@/components/Login'
import UserList from '@/components/UserList'
import Rights from '@/components/Rights'
import roles from '@/components/roles'

Vue.use(Router)

export default new Router({
  routes: [
    // {path: '/', name: 'HelloWorld',component: HelloWorld},
    // 使用嵌套路由(子路由)
    {
      path: '/', name: 'Index', component: Index,
      children: [
        { path: 'userlist', component: UserList },
        { path: 'rights', component: Rights },
        { path: 'roles', component: roles },
      ]
    },
    { path: '/login', name: 'Login', component: Login },
  ]
})
